//
//  LSCashVC.m
//  HappyStore
//
//  Created by 陈锋 on 16/8/11.
//  Copyright © 2016年 LLJ. All rights reserved.
//

#import "LSCashVC.h"
#import "LSPayResultVC.h"
#import "LSCashAlipayVC.h"

@interface LSCashVC ()

@property (weak, nonatomic) IBOutlet UITextField *cashText;
@property (weak, nonatomic) IBOutlet UILabel *cashLabel;
@property (weak, nonatomic) IBOutlet UIButton *nextBtn;

@end

@implementation LSCashVC

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"白色背景"] forBarMetrics:UIBarMetricsDefault];
}
- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
}

- (void)viewDidLoad {
    [super viewDidLoad];
   
//    self.title = @"提现";
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 190, 44)];
    titleLabel.backgroundColor = [UIColor clearColor];
    titleLabel.font = [UIFont systemFontOfSize:19];
    titleLabel.text = @"提现";
    titleLabel.textColor = RGB(45, 45, 45);
    titleLabel.textAlignment = NSTextAlignmentCenter;
    self.navigationItem.titleView = titleLabel;
    
    //设置返回按钮
    UIBarButtonItem *leftItem = [UIBarButtonItem itemWithTarget:self action:@selector(leftBarButtonItemClick) image:@"返回" highImage:@"返回"];
    self.navigationItem.leftBarButtonItem = leftItem;
    self.nextBtn.layer.masksToBounds = YES;
    self.nextBtn.layer.cornerRadius = 5.0f;
    
    self.cashLabel.text = self.cashStr;
    
    //开启侧滑
    self.navigationController.interactivePopGestureRecognizer.delegate = (id)self;
}
-(void)leftBarButtonItemClick{
    [self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)clickNextBtn:(UIButton *)sender {
    
    if (self.cashText.text.length != 0) {
        
        LSCashAlipayVC * LSCashAlipay = [[LSCashAlipayVC alloc]init];
        LSCashAlipay.payNo = self.cashText.text;
        [self.navigationController pushViewController:LSCashAlipay animated:YES];
        self.cashText.text = @"";
        
    }else{
        
        NSString *strMsg = @"金额不能为空";
        
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"支付情况" message:strMsg delegate:self cancelButtonTitle:@"知道了" otherButtonTitles:nil, nil];
        [alert show];
        
    }
}


@end
